/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package utn.tsb.tej.comunications;

import com.trolltech.qt.gui.QMessageBox;
import com.trolltech.qt.gui.QMessageBox.Icon;

/**
 * This class contains the information given on the result of a Request.
 * @author Carlos S. Moreno <CarlosS.Moreno@gmail.com>
 */
public class RequestResult {

    private String title, text;
    private Icon icon;
    private boolean success;
    private Object requestObject;

    /**
     * RequestResult Constructor
     * @param title Title of the Request
     * @param text Main message of the result
     * @param success How did the request ended
     */
    public RequestResult (String title, String text, boolean success)
    {
        this (title, text, success, QMessageBox.Icon.NoIcon);
    }

    /**
     * RequestResult Constructor
     * @param title Title of the Request
     * @param text Main message of the result
     * @param success How did the request ended
     * @param icon a QMessageBox.Icon for a QMessageBox
     */
    public RequestResult (String title, String text, boolean success , Icon icon)
    {
        this.title = title;
        this.text = text;
        this.success = success;
        this.icon = icon;
    }

    /**
     * @return the title
     */
    public String getTitle() {
        return title;
    }

    /**
     * @return the text
     */
    public String getText() {
        return text;
    }
    
    /**
     * @return the icon
     */
    public Icon getIcon() {
        return icon;
    }

    /**
     * @param title the title to set
     */
    public void setTitle(String title) {
        this.title = title;
    }

    /**
     * @param text the text to set
     */
    public void setText(String text) {
        this.text = text;
    }

    /**
     * @param icon the icon to set
     */
    public void setIcon(Icon icon) {
        this.icon = icon;
    }

    /**
     * @return the success
     */
    public boolean isSuccess() {
        return success;
    }

    /**
     * @param success the success to set
     */
    public void setSuccess(boolean success) {
        this.success = success;
    }

    /**
     * @return the requestObject
     */
    public Object getRequestObject() {
        return requestObject;
    }

    /**
     * @param requestObject the requestObject to set
     */
    public void setRequestObject(Object requestObject) {
        this.requestObject = requestObject;
    }

}
